package net.comm.shequ.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.blog.bean.BaseBlog;
import net.comm.param.bean.BaseProperty;
import net.comm.shequ.bean.BaseShequ;
import net.comm.shequ.bean.BaseYewei;
import net.comm.shequ.bean.BaseYwMember;
import net.comm.shequ.bean.BaseYwYanzh;
import net.comm.util.StringUtil;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbYwYanzhService implements SqlReader
{

	static Logger logger = Logger.getLogger(DbYwYanzhService.class.getName());

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{		
			int yeweiID 	= result.getInt(1);	//	业委ID
			int userID 		= result.getInt(2);		//	用户ID
			String status 	= StringUtil.getValue(result.getString(3));	//	状态
			String mtime 	= StringUtil.getValue(result.getString(4));	//	最后修改时间

			// create the Resource from these fields
			return new BaseYwYanzh( yeweiID,  userID, status, mtime);
		}
		catch (SQLException e)
		{
			logger.error("读取表数据持久层失败！");
			return null;
		}
		
	}
}
